<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('个人测评成绩报告列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
<!--                            <li>-->
<!--                                <label>测评量表id：</label>-->
<!--                                <input type="text" name="scaleId"/>-->
<!--                            </li>-->
                            <li>
                                <label>测评量表标题：</label>
                                <input type="text" name="scaleTitle"/>
                            </li>
<!--                            <li>-->
<!--                                <label>用户id：</label>-->
<!--                                <input type="text" name="userId"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>登录账号：</label>-->
<!--                                <input type="text" name="loginName"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>用户昵称：</label>-->
<!--                                <input type="text" name="userName"/>-->
<!--                            </li>-->
                            <li>
                                <label>总分：</label>
                                <input type="text" name="countScore"/>
                            </li>
<!--                            <li>-->
<!--                                <label>因子的分数：</label>-->
<!--                                <input type="text" name="factorScore"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>班级：</label>-->
<!--                                <input type="text" name="classesName"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>学院：</label>-->
<!--                                <input type="text" name="deptName"/>-->
<!--                            </li>-->
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:result_personal:add">-->
<!--                    <i class="fa fa-plus"></i> 添加-->
<!--                </a>-->
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:result_personal:edit">
                    <i class="fa fa-edit"></i> 详情
                </a>
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:result_personal:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:result_personal:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:result_personal:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:result_personal:remove')}]];
        var prefix = ctx + "system/result_personal";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                clickToSelect: true,
                rememberSelected: true,
                modalName: "测评成绩报告信息",
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'resultId',
                        title: '测评结果id',
                        visible: false
                    },
                    {
                        field: 'scaleTitle',
                        title: '测评量名称'
                    },
                    {
                        field: 'loginName',
                        title: '登录账号',
                        visible: false
                    },
                    {
                        field: 'userName',
                        title: '用户昵称'
                    },
                    {
                        field: 'classesName',
                        title: '班级'
                    },
                    {
                        field: 'deptName',
                        title: '学院'
                    },
                    {
                        field: 'countScore',
                        title: '总分'
                    },
                    {
                        field: 'factorScore',
                        title: '因子分数'  ,
                        width: '15',
                        widthUnit: '%',
                    },
                    {
                        field: 'resultContent',
                        title: '分数范围和结果提示',
                        width: '15',
                        widthUnit: '%',
                        align: "left",
                        formatter: function (value, row, index) {
                            return $.table.tooltip(value);
                        }
                    },
                    {
                        field: 'factorResult',
                        title: '因子的分数范围及结果提示'  ,
                        width: '15',
                        widthUnit: '%',
                        align: "left",
                        formatter: function (value, row, index) {
                            return $.table.tooltip(value);
                        }
                    },
                    {
                        field: 'userAnswer',
                        title: '用户选择数据' ,
                        width: '15',
                        widthUnit: '%',
                        align: "left",
                        formatter: function (value, row, index) {
                            return $.table.tooltip(value);
                        }
                    },
                    {
                        title: '操作',
                        align: 'center',
                        formatter: function(value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.resultId + '\')"><i class="fa fa-edit"></i>详情</a> ');
                            // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.resultId + '\')"><i class="fa fa-remove"></i>删除</a>');
                            return actions.join('');
                        }
                    }]
            };
            $.table.init(options);
        });

    </script>
</body>
</html>